﻿using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using ShootSearch.Core;
using ShootSearch.Jobs;
using ShootSearch.Util.Serializers;

namespace ShootSearch.Tests.Core
{
    [TestFixture]
    public class QuickTests
    {
        public static void Run()
        {
            QuickTests obj = new QuickTests();
            obj.QTest();

        } 

        [Test]
        public void QTest()
        {
            //Quartz.ISchedulerFactory factory = new Quartz.Impl.StdSchedulerFactory();
            //Quartz.IScheduler scheduler = factory.GetScheduler();


            TaskConfig expected = new TaskConfig();
            expected.Jobs.Add(new JobConfig(new HttpSpiderJob()));
            expected.Jobs.Add(new JobConfig(new IndexBuilderJob()));

            string xml = XmlFormatter.ToXml(expected);

            TaskConfig actual = XmlFormatter.FromXml(xml, expected.GetType()) as TaskConfig;
            
            Assert.AreNotEqual(null, actual);

            Assert.AreEqual(expected.Jobs.Count, actual.Jobs.Count);

        }
    }
}
